#ifndef __CYLINDER_H__
#define __CYLINDER_H__

#include "Assembly.h"
#include "Face.h"

// reimplementation of the GLU-Cylinder
//	cylinder is symmetric along the Y-Axis
//	on the Y-Axis its range is [-h/2 .. h/2]

#include <vector>
using std::vector;

class Cylinder : public  Assembly
{
public:
	// ctor
	Cylinder();
	
	Cylinder(const Vertex& dim);
	Cylinder(float top, float bottom, float height);
	
	Cylinder(const Vertex& dim, const Vertex& pos);
	Cylinder(float top, float bottom, float height,
	         float x, float y, float z);
	         
	Cylinder(const Vertex& dim, const Vertex& pos, const Vertex& rot);
	Cylinder(float top, float bottom, float height,
	         float x, float y, float z,
	         float a, float b, float g);
	         
	// dtor
	virtual ~Cylinder();
	
	// getter/setter methods for cylinder dimensions
	const Vertex& dimensions() const;
	Vertex& dimensions();
	
private:
	// r_top, r_bottom, height
	Vertex m_dimensions;
	
	// setup vertex, normals, faces
	void init();
	
	// update the vertex/normals
	void update_vertex();
	
	// [stack][slice], stack0 is the upmost stack
	vector<vector<Vertex*> > m_vertex;
	vector<Vertex*>	m_normal;
	
	// # of segments
	static int SLICES;
};

#endif

